package javaweb.controller;

import javaweb.pojo.LogPageResult;
import javaweb.pojo.LogQueryParam;
import javaweb.pojo.Result;
import javaweb.sevice.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    private LogService logService;

    /*
    * 查询日志信息
    * */
    @GetMapping("/page")
    public Result getLog(LogQueryParam logQueryParam){
        log.info("日志传递的参数为 {}", logQueryParam);
        LogPageResult logPageResult = logService.getLog(logQueryParam);
        return Result.success(logPageResult);
    }
}
